/*
 * Copyright (C) 2024, KylinSoft Co., Ltd.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 *
 * Authors: zy-yuan1 <zhangyuanyuan1@kylinos.cn>
 *
 */
import QtQuick 2.15
import org.ukui.digitalclock 1.0
import QtGraphicalEffects 1.15

Rectangle {
    implicitWidth: 106
    implicitHeight: 40
    radius: 6
    color: Qt.rgba(255, 255, 255, 0.5)
    border.color: "black"

    Digitalclock {
        id: clock
    }

    Image {
        id: backgroundImg
        anchors.fill: parent
        fillMode: Image.Stretch
        source: "qrc:///res/background.png"
        smooth: true
        visible: false
    }
    Rectangle {
        id: mask
        anchors.centerIn: parent
        width: parent.width - 2
        height: parent.height - 2
        radius: 6
        visible: false
    }
    OpacityMask {
        anchors.centerIn: parent
        width: parent.width - 2
        height: parent.height - 2
        source: backgroundImg
        maskSource: mask
    }

    Text {
        anchors.centerIn: parent
        text: clock.time
        font.pointSize: 18
    }
}
